package com.oj.judge.codesandbox;

import com.oj.judge.codesandbox.impl.ExampleCodeSandBox;
import com.oj.judge.codesandbox.impl.RemoteCodeSandBox;
import com.oj.judge.codesandbox.impl.ThirdPartyCodeSandBox;

/**
 * @Classname CodeSandBoxFactory
 * @Description TODO
 * @Date 2025/3/17 23:14
 * @Created by xxx
 */

public class CodeSandBoxFactory {

    /*
     * 创建代码沙箱示例
     * @param type 沙箱类型
     * @return
     * */
    public static CodeSandBox NewInstance(String type) {
        switch (type) {
            case "example":
                return new ExampleCodeSandBox();
            case "remote":
                return new RemoteCodeSandBox();
            case "thirdParty":
                return new ThirdPartyCodeSandBox();
            default:
                return new ExampleCodeSandBox();
        }
    }
}
